/*****************************************************************************
 *
 * 作   者: 马婷婷.
 * 创建时间: 2020/12/10 15:21:38.
 *
 * Copyright (C) 2008 - 鹏业软件公司
 *
 *****************************************************************************/

// @ts-ignore
import {DataPacket, QueryDataList } from 'pengesoft-ng-lib';


/**
 * 部门.
 */
// @MataData('Dept')
export class Departments extends DataPacket {
  /**
   * id.
   */
  Id: string;
  /**
   * 父部门id.
   */
  Pid: string;
  /**
   * 部门名称.
   */
  DeptName: string;
  /**
   * 部门负责人.
   */
  DeptPerson: string;
  /**
   * 负责人联系方式.
   */
  DeptPhone: string;

  constructor(options: any | {
    Id?: string;
    Pid?: string;
    DeptName?: string;
    DeptPerson?: string;
    DeptPhone?: string;
  } = {}) {
    super();
    this.Id = options.Id || '';
    this.Pid = options.Pid || '';
    this.DeptName = options.DeptName || '';
    this.DeptPerson = options.DeptPerson || '';
    this.DeptPhone = options.DeptPhone || '';
  }
}


/**
 * 部门列表
 */
// @MataData('DeptList')
export class DeptList extends QueryDataList<Departments> {

  constructor(options: any | {
    _Items?: Array<Departments>
  } = {}) {
    // @ts-ignore
    super(options);
    if (options._Items) {
      for (const item of options._Items) {
        this.append(new Departments(item));
      }
    }
  }
}

